package com.arvts.android.project.adapter;

import java.util.ArrayList;

import com.arvts.android.project.R;
import com.arvts.android.project.model.Vehicle;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class VehicleDetailsAdapter extends ArrayAdapter<Vehicle> {
	Context context;
	ArrayList<Vehicle> list;
	
	public VehicleDetailsAdapter(Context context, ArrayList<Vehicle> list){
		
		super(context, R.layout.row_vehicle_details, list);
		this.context = context;
		this.list = list;		
	}
	
	
	@Override
	public View getView(final int position, final View convertView, final ViewGroup parent) {
		LayoutInflater inflater = null;
		View row = null;
		
		inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		row = inflater.inflate(R.layout.row_vehicle_details, parent, false);
				
		TextView vehicleNo = (TextView) row.findViewById(R.id.tv_vehicle_no);
		//TextView vehicleDetails = (TextView) row.findViewById(R.id.tv_vehicle_details);
	
		vehicleNo.setText(" -  "+list.get(position).getVEHICLE_NUMBER().toString().toUpperCase());
		//vehicleDetails.setText(list.get(position).getVEHICLE_TYPE());
						
		return row;
	}
}
